home *** CD-ROM | disk | FTP | other *** search
/ MacWorld 1998 May / Macworld (1998-05).dmg / Shareware World / Comms & Internet / ProTERM_1.2.5.Install / ProTERM Mac1.2.5 / Macros / Resident User Custom 1202 < prev    next >
Text File  |  1998-01-14  |  10KB  |  374 lines

  1. /****************************************************
  2. *                                                   *
  3. *  ProTERM/Mac Resident User Macro Custom Template  *
  4. *                                                   *
  5. *       Version 1202  Updated Dec 15, 1997          *
  6. *       For ProTERM Mac 1.2.5 or later            *
  7. *                                                   *
  8. ******************************************************/
  9.  
  10. /*
  11.  1- The referenced parts used with this file need to be in the
  12.     ProTERM > Extras > Custom FKey Kit folder.
  13.  2- For details, see the notations in this file and see “!Read Me!” in
  14.     the “Custom FKey Kit” folder.
  15.  
  16. This custom files set adds functionality and F-Key automation for email composition, formatting and reformating capability, templates for use with ProTERM Message Manager (PTMM), and general message management.
  17.  
  18. This macro set is an example of how to create macros F-Key macros that work for you. You can rename this file to Resident User Your Name and change the commands to suit your needs. I hope it helps you, gives you ideas for other macro and F-key use, and makes your work easier.
  19.  
  20. We want your ideas on how you revise this set, or would like this set revised suit your personal needs. With your ideas, we can build a modular sets of plug ’n play scripts with something for everyone. We’ll be looking for your notes at: ptmm@intrec.com
  21.  
  22.  - Jerry Cline
  23.  
  24. F-Keys Defined
  25.  F1 key macro Begin Reply Format command
  26.  F2 key macro End Reply format command
  27.  F3 key macro Paste a custom text file into a document at the insertion point.
  28.  F4 key macro Open a Calendar File.
  29.  F5 key macro Paste dot-command set for hanging paragraph (used with bullets).
  30.  F6 key macro Paste dot-command set for hanging paragraph (used with numbers).
  31.  F7 key macro Create a new doc with a mail+fortune header.
  32.  F8 key macro Open the AutoMailer from the PTMM > Compose menu.
  33.  F9 key macro Autoreply to mail or forum post.
  34. F10 key macro #1 Open a new doc and paste a mail header at the top. (Disabled) 
  35. F10 key macro #2 Paste a mail header at the top of an existing doc. (Enabled)
  36. F11 key macro Save a file to the Working folder
  37. F12 Remove all double spaces, and move all text flush left.
  38. F13 key macro Remove all “>” characters from a document.
  39. F14 key macro Open a sample URLs window used for COMMAND-click within ProTERM.
  40. F15 key macro Remove leading left spaces.
  41.  
  42. Details below are associated with the individual macro scripts.
  43. */
  44.  
  45. //
  46. // Special “link” code just in case file is executed directly
  47. //
  48. FUNC main()
  49. {
  50. EXTERN(PREF_GET("mac1"),main(1));
  51. RETURN;
  52. }
  53.  
  54. /***********************************************************************/
  55. /*                   Start of Startup Macros                           */
  56. /***********************************************************************/
  57.  
  58. FUNC startup()
  59. {
  60. //
  61. // Add startup macro variables after this comment
  62. //
  63.  
  64. // leave this code unchanged
  65. RESIDENT(“”,0,#KeyAccess+#LibAccess);
  66. RETURN;
  67. }
  68.  
  69.  
  70. /***********************************************************************/
  71. /*                   Start of Keyboard Macros                          */
  72. /***********************************************************************/
  73.  
  74.  
  75. //
  76. // F1 key macro
  77. FUNC KED_007A()
  78. //
  79.  
  80. /* Mark Start of Reply Formatting (for Send ASCII). 
  81.  F-1 and F-2 are possibly the most used commands in all the work I do in replying to mail. 
  82.  
  83. When using this command a couple of steps can be added that will enhance your
  84.   ability to format any kind of text.
  85.   1- If there are leading spaces on the left of the text, use the F-15 macro
  86.      to move the text to left-flush.
  87.   2- Select the text to be formatted and choose Paragraph Format from the
  88.      Edit > Convert menu. This removes the extra return characters from the
  89.      selected text.
  90.   3- Place the cursor directly in front of the first character in the text
  91.      being replied to, and press F-1.
  92.   4- Follow the text being replied to with the F-2 command which closes and
  93.      ends the reply format.
  94.  
  95.  > This paragraph shows Reply Formatting.
  96.  > To see what the formatted text will look like after it is sent,
  97.  > choose Format Test from the Edit menu. The big advantage of using 
  98.  > this formatting will be seen when the text is uploaded to the service
  99.  > as it is always the correct width an format for any service you call.
  100.  
  101. Formatting is done “on the fly,” and its automatic so you do not need to reformat text before it is sent in an online message. This automatic formatting also considers narrower width windows that may be used on some services.
  102. */
  103.  
  104. {
  105.  UI_TYPE('ºre(“ > ”)ººrm-6º^m');
  106.  RETURN;
  107. }
  108. end;
  109.  
  110.  
  111. //
  112. // F2 key macro
  113. FUNC KED_0078()
  114. //
  115.  
  116. /* 
  117. This is the closing command for the F-1 begin reply format — it marks the end of reply formatting.
  118. */
  119. {
  120.  UI_TYPE('ºreººrm+6º^m');
  121.  RETURN;
  122. }
  123. end;
  124.  
  125. //
  126. // F3 key macro
  127. FUNC KEY_0063()
  128. //
  129.  
  130. /* 
  131. Print sigfile into a document window. A good example of the User Interface Type (UI_TYPE) command.
  132. */
  133.  
  134. {
  135. UI_OPEN(".APPL:Extras:Custom FKey Kit:Fkeys");
  136.  
  137. return();
  138. }
  139. end;
  140.  
  141.  
  142.  
  143. //
  144. // F4 key macro
  145. FUNC KEY_0076()
  146. //
  147.  
  148. /*
  149. Open the file named 96-99 Calendar. (If you have access to a Unix shell, you can get a calendar for any year by typing  cal 1997  (or applicable year).)
  150. */
  151. {
  152. UI_OPEN(":ProTERM:Extras:Calendar");
  153. return();
  154. }
  155. end;
  156.  
  157. //
  158. // F5 key macro
  159. FUNC KED_0060()
  160. //
  161.  
  162. /*
  163. • Paste beginning and ending dot-commands used for hanging paragraph
  164.   format used with left-flush bullets per this example.
  165. */
  166. //
  167. {
  168. UI_TYPE
  169. ('ºlm3ººpm-2ººrm-4º
  170. ºlmººpmººrm+4º
  171. ')
  172. RETURN;
  173. }
  174. end;
  175.  
  176.  
  177. //
  178. // F6 key macro
  179. FUNC KED_0061()
  180. //
  181.  
  182. /*
  183.  1- Paste beginning and ending dot-commands used for 4 space hanging
  184.     paragraph for number formatting indent paragraphs. Note the format of
  185.     this set of numberd paragraphs which were made with this dot-command. 
  186.  2- Space single digit number in one space, and place double digit numbers
  187.     flush against the left margin. These formatting commands align the text
  188.     into the format shown in this example.
  189. */
  190. //
  191. {
  192. UI_TYPE
  193. ('ºlm4ººpm-4ººrm-4º
  194. ºlmººpmººrm+4º
  195. ')
  196. RETURN;
  197. }
  198. end;
  199.  
  200.  
  201. //
  202. // F7 key macro
  203. FUNC key_0062()
  204. //
  205.  
  206. /* Open new document window and paste header for mail with alias name already inserted in the document. For details on using alias names, see Address Book in the PTMM Help menu. */
  207.  
  208. UI_MENU("file:new"); UI_TYPE($087E); UI_TYPE($087B); // option-up, option-left
  209. UI_TYPE
  210. ('Mail: {name}
  211. Sub: 
  212. ');
  213. RETURN;
  214. }
  215. end;
  216.  
  217.  
  218. //
  219. // F8 key macro
  220. FUNC KED_0064()
  221. //
  222. // Open the Mail auto header from the PTMM > Compose menu.
  223. // An example of the User Interface Menu (UI_Menu) command.
  224. {
  225. UI_MENU("PTMM:Compose: Mail");
  226. return();
  227. }
  228. end;
  229.  
  230. //
  231. // F9 key macro
  232. FUNC KED_0065()
  233. //
  234.  
  235. // Choose PTMM Reply from the PTMM menu
  236. UI_MENU(“PTMM:Reply to Message”); 
  237. return();
  238. end;
  239. }
  240. end;
  241.  
  242.  
  243. //
  244. // F10 key macro #1
  245. // 1st alternate - NOTE THIS MACRO IS PRESENTLY DISABLED
  246. //FUNC KED_006D()
  247. //
  248.  
  249. /*
  250. Note there are two F10 macros, but since only one can be used at a time, the F10 key macro #1 is presently disabled. To enable #1, remove the two slash marks from in front of the “FUNC KED_006D()” on this macro, and place them in front of “FUNC KED_006D()” on the F10 key macro #2 tol disable #2.
  251.  
  252. Macro function: Open a new document and paste a PTMM email header at the top of the document. An example of the UI_MENU (UI_MENU_ command.
  253. */
  254.  
  255. // NOTE - THIS MACRO IS CURRENTLY DISABLED
  256.   Remove these markers to the note below to enable this macro
  257. {
  258. UI_MENU("file:new");
  259. UI_TYPE($087E); UI_TYPE($087B);   option-up, option-left
  260. UI_TYPE
  261. ('Mail: 
  262. Sub: 
  263. ')
  264. RETURN;
  265. }
  266. end;
  267.  
  268.  
  269. // F10 key macro #2
  270. // 2nd alternate - NOTE THIS MACRO IS PRESENTLY ENABLED
  271. FUNC KED_006D()
  272. //
  273.  
  274. // Paste a PTMM email header at the top of an existing open document.
  275. {
  276. UI_TYPE($087E); UI_TYPE($087B); // option-up, option-left
  277. UI_TYPE('Mail: 
  278. Sub: 
  279. ')
  280. RETURN;
  281. }
  282. end;
  283.  
  284.  
  285. //
  286. // F11 key macro.
  287. FUNC key_0067()
  288. //
  289.  
  290. // Save the document to PTMM Working folder
  291. UI_MENU(“PTMM:Save to Working”); 
  292. return();
  293. }
  294. end;
  295.  
  296.  
  297. //
  298. // F12 key macro
  299. //
  300.  
  301. /*
  302. Remove all double spaces, and move all text flush left.
  303. Warning, this action will only undo the very last change to the last character changed.
  304. */
  305.  
  306. FUNC ked_006F()
  307. // Remove double spaces and move all flush left.
  308. {
  309. UI_CMD('cmd=find wind=acti find="  " repl="" case=exac dir=forw from=star');
  310. UI_CMD('cmd=find wind=acti find="^m " repl="^m" case=exac dir=forw from=star');
  311. RETURN;
  312. }
  313.  
  314.  
  315. //
  316. // F13 key macro
  317. FUNC ked_0069()
  318. //
  319.  
  320. /*
  321. Some telecom messages have a “>” (greater than or angle-bracket) used in reply formatted text. This form of replying to text using this character is conventional in telecommunications messages, but their presence can make reading, and a re-reply difficult. This F-key command removes all greater-than characters from a document. The function replaces “>” with “” (replaces the ”greater than” with “no character”). Use F-15 to remove any remaining or extra spaces from the left margin.
  322.  
  323. WARNING! This macro works on the entire document, top to bottom and the Undo command will only revert the last change to the last character. Experiment with this command to get a feel for what it can do for you.
  324.  
  325. This is a good example of the User Interface Command (UI_CMD) command.
  326. */
  327. {
  328. UI_CMD('cmd=find wind=acti find=">" repl="" case=exac dir=forw from=star');
  329. }
  330. end;
  331.  
  332. //
  333. // F14 key macro
  334. FUNC KEY_006B()
  335. //
  336.  
  337. /*
  338. Open the document with all the oft-used URLs so they can be COMMAND-Clicked and open the needed URL app via Internet Config. The URLs document is stored in the ProTERM > Extras folder. A good example of the UI_OPEN command
  339. */
  340. {
  341. UI_OPEN(":ProTERM:Extras:URLs");
  342. return();
  343. }
  344. end;
  345.  
  346.  
  347. //
  348. // F15 key macro
  349. FUNC KED_0071()
  350. //
  351.  
  352. /*
  353. Some telecom users use a text format that includes leading left column spaces or tabbed paragraphs. This formatting form is generally unconventional in telecommunications messages, inhibits reformatting, and can make documents difficult to read and follow. Using this F-key command removes one leading left column space each time it is used. The function replaces “^M+SPACE” with “^M”
  354. This is a good example of the User Interface Command (UI_CMD) command.
  355.  
  356. WARNING! This macro works on the entire document, top to bottom and the Undo command will only revert the last change. Experiment with this command to get a feel for what it can do for you.
  357.  
  358. This is a good example of the User Interface Command (UI_CMD) command.
  359. */
  360. {
  361. UI_CMD('cmd=find wind=acti find="^M " repl="^M" case=exac dir=forw from=star');
  362. }
  363. end;
  364.  
  365.  
  366.  
  367. //
  368. // Jerry Cline
  369. // Last Updated: Nov 15, 1997
  370. // ©1997 InTrec Software, Inc.
  371. //
  372.